﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LeoMVC.Domain
{
    public class Category:EntityBase
    {
        public virtual string Name { get; set; }
        public virtual IList<Product> Products { get; set; }
        public virtual string Description { get; set; }

        public Category()
        {
            Products=new List<Product>();
        }

        public Category(string name):this()
        {
            Name = name;
        }

        public virtual void AddProduct(Product product)
        {
            Products.Add(product);
            product.Category = this;
        }

    }
}
